[audit] fix: use "buf" instead of deprecated "buffer" key in keymap opts - #331
Draft
stanfish06 wants to merge 1 commit into
Draft
[audit] fix: use "buf" instead of deprecated "buffer" key in keymap opts#331stanfish06 wants to merge 1 commit into
stanfish06 wants to merge 1 commit into
Conversation
vim.keymap.set.Opts renamed "buffer" to "buf" (runtime/doc/deprecated.txt). lsp.lua's BUF constant still used the old name for the two buffer-local LspAttach keymaps (gd, <leader>la). No behavior change, just drops the deprecation warning ahead of it becoming a hard error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
runtime/doc/deprecated.txt(deprecated-0.12section) renames the"buffer"key accepted byvim.keymap.set.Opts/vim.keymap.del.Optsto"buf".lua/config/lsp.lua:8defineslocal BUF = "buffer", which is used as the buffer-local option key for the twoLspAttachkeymaps (gd,<leader>la) at lines 136-137. That's the old, deprecated spelling.Where
lua/config/lsp.lua:8(and its two use sites at:136and:137, unchanged — only the constant's value changes).Why it matters
Confirmed via
runtime/doc/deprecated.txtonneovim/neovimmaster:This is the only place in the repo using the old key —
plugin_config.lua's"buffer"string is an unrelated blink.cmp completion source name, not a keymap opts key (verified via repo-wide grep). Left as-is, this keeps emitting a deprecation warning today and will break once Neovim removes the old key outright, same pattern as the other option/API renames already tracked in #283.Fix
One-line rename of the
BUFconstant from"buffer"to"buf". No behavior change — both spellings currently work identically, this just uses the current name.Generated by Claude Code